package com.yiban.demo.Order.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderVO {
    @NotNull(message = "订单号不得为空",groups = updateOrderGroup.class)
    private Long orderId;
    @NotBlank(message = "收件人不得为空",groups = insertOrderGroup.class)
    private String receiverName;
    @NotBlank(message = "收件人手机号不得为空",groups = insertOrderGroup.class)
    private String phone;
    @NotBlank(message = "收件人地址不得为空",groups = insertOrderGroup.class)
    private String deliveryAddress;
    @NotBlank(message = "快件位置不能为空",groups = insertOrderGroup.class)
    private String packagePos;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Null(message = "无需传入下单时间",groups = {insertOrderGroup.class,updateOrderGroup.class})
    private Date startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Null(message = "无需传入开始配送时间",groups = {insertOrderGroup.class,updateOrderGroup.class})
    private Date deliveryStartTime;
    @NotNull(message = "需要站点信息",groups = insertOrderGroup.class)
    private Integer stationId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Null(message = "无需传入结束时间",groups = {insertOrderGroup.class,updateOrderGroup.class})
    private Date endTime;
    @Null(message = "无需传入设备id",groups = insertOrderGroup.class)
    @NotNull(message = "需要传入设备id",groups = updateOrderGroup.class)
    private String deliveryDeviceId;
    @Null(message = "无需传入状态信息",groups = {insertOrderGroup.class,updateOrderGroup.class})
    private String status;
}
